<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>

<body>
<script>


var s = "how are you";
var r = /(?:\w+)$/;
var a = s.match(r); 				// 返回数组["you"]

var s = "how are you";
var r = /^(?:\w+)/;
var a = s.match(r); 				// 返回数组["how"]

var s = "how are you";
var r = /(?:\w+)/g;
var a = s.match(r); 				// 返回数组["how", "are" , "you"]


</script>
</body>
</html>
